<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/default.css" />
		<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="css/style1.css" />
		<style type="text/css">
			.m-icon-bluev {
				display: inline-block;
				width: 10px;
				height: 10px;
				background-color: #939634;
				position: absolute;
				left: 28px;
				bottom: 13px;
			}
			
			.tianjian:before {
				width: 24px;
				height: 48px;
				position: absolute;
				bottom: 0;
				right: 10px;
				background: url('images/iconfont-tianjia.png') no-repeat bottom right /24px 48px;
				content: '';
				-webkit-transform: scaleY(.5);
				transform: scaleY(.5);
			}
			
			.touxiang:before {
				width: 24px;
				height: 40px;
				position: absolute;
				bottom: 0;
				left: 30%;
				background: url('images/titleimg.png') no-repeat bottom right /13px 43px;
				content: '';
				-webkit-transform: scaleY(.5);
				transform: scaleY(.5);
			}
			/*.mui-slider {
				margin-top: 50px;
			}*/
		</style>
	</head>

	<body>
		<!--内容页-->
		<div class="mui-content">
			<nav class="mui-bar mui-bar-tab" id='footer'>
				<a class="mui-tab-item mui-active" id='home'>
					<span class="mui-icon mui-icon-home"></span>
					<span class="mui-tab-label">黑皮书1</span>
				</a>
				<a class="mui-tab-item" id='personpage'>
					<span class="mui-icon mui-icon-person"></span>
					<span class="mui-tab-label">我的</span>
				</a>
			</nav>
			<div id="pullrefresh" class="mui-scroll-wrapper">
				<div class="mui-scroll">
					<ul class="mui-table-view" id='tabcell2'>
						<!--<li class="mui-table-view-cell lists1">
							<h3 class="blacker-big">每日币市龙虎榜</h3>
							<section>
								<a href="coindetail2.html">
									<dl class="leftslide fl">
										<dd class="blacker-small">EOS领涨<span class="green-small">+2.39%</span></dd>
										<dd>
											<span class="grey-light">总数：3</span>
											<span class="grey-light">上涨：2</span>
											<span class="grey-light">下跌：1</span>
										</dd>
										<dd>
											<img src="http://placehold.it/40x30" alt="" class='imgsma-peopl' />
											<i class="m-icon-bluev"></i>
											<span class="blacker-small">金木研</span>
											<span class="grey-light">创建</span>
										</dd>
									</dl>

									<dl class='rightslide fr'>
										<dd class="tr blacker-small">平均涨跌</dd>
										<dd class="tr green-big">+1.29%</dd>
										<dt></a>
        					<p>
        						<span class="iconfont icon-yanjing"></span>
        						<span class='grey-smaller'>2100</span>
        						<span class="iconfont icon-xingxing"></span>
        						<span class="grey-smaller">1920</span>
        					</p>
        				</dt>
									</dl>
							</section>

						</li>-->
					</ul>
				</div>
			</div>

		</div>

		<!--内容盒子结束-->

		<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-2.1.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="js/config.js" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8">
			mui.init({
				pullRefresh: {
					container: "#pullrefresh", //下拉刷新容器标识，querySelector能定位的css选择器均可，比如：id、.class等
					down: {
						style: 'circle', //必选，下拉刷新样式，目前支持原生5+ ‘circle’ 样式
						color: '#2BD009', //可选，默认“#2BD009” 下拉刷新控件颜色
						height: '50px', //可选,默认50px.下拉刷新控件的高度,
						range: '100px', //可选 默认100px,控件可下拉拖拽的范围
						offset: '0px', //可选 默认0px,下拉刷新控件的起始位置
						auto: true, //可选,默认false.首次加载自动上拉刷新一次
						callback: pulldownRefresh //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
					}
				}
			});

			function pulldownRefresh() {
				myfollow();
				mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
				mui.toast("刷新完成");
			}

			function myfollow() {
				var uid = localStorage.getItem("uid");
				if(uid == null || uid == "") {
					toLogin();
					return;
				}
				//我的关注
				mui.ajax(mkurl + '/api/market/myfollow', {
					data: {
						uid: uid,
						pageNumber: 1,
						pageSize: 10
					},
					dataType: 'json',
					type: 'post',
					success: function(data) {
						$('#tabcell2').html('');

						if(data.status == 1) {
							var cData = data.result;
							var tabcell;
							if(cData) {
								for(var i = 0; i < cData.length; i++) {
									var fun = 'toListDetail("' + cData[i].hid + '")';
									var brcont = cData[i].browseCount;
									if(brcont == null || brcont == "") {
										brcont = 0;
									}
									var followCount = cData[i].followCount;
									tabcell = '<li class="mui-table-view-cell lists1" id="coin_list"' + [i] +
										'><a onclick=' + fun + '><h3 class="blacker-big">' + cData[i].title +
										'</h3><section><dl class="leftslide fl"><dd class="blacker-small">' + cData[i].rHUom +
										'&nbsp;<span class="green-small">' + cData[i].rhAverage +
										'%</span></dd><dd><span class="grey-light">总数:' + cData[i].totalCount +
										'</span><span class="grey-light">上涨:' + cData[i].rCount +
										'</span><span class="grey-light">下跌：' + cData[i].fCount +
										'</span></dd><dd><img src="images/header.png" alt="" class="imgsma-peopl" />' +
										'<i class="m-icon-bluev"></i><span class="blacker-small">' + cData[i].nickname +
										'</span><span class="grey-light">创建</span></dd></dl><dl class="rightslide fr">' +
										'<dd class="tr blacker-small">平均涨跌</dd><dd class="tr green-big">' + cData[i].averageRF +
										'%</dd><dt><p><span class="iconfont icon-yanjing"></span>' +
										'<span class="grey-smaller">' + brcont + '</span><span class="iconfont icon-xingxing"></span>' +
										'<span class="grey-smaller">' + followCount + '</span></p></dt></dl></section></a></li>';
									$('#tabcell2').append(tabcell);
								}
							} else {
								mui.toast("暂无数据");
							}
						} else if(data.code == -1) {
							toLogin();
						} else {
							mui.toast(data.message)
						}
					},
					error: function(xhr, type, errorThrown) {
						//异常处理；
						console.log(type);
					}
				});
			}

			function toListDetail(hid) {
				mui.ajax(userurl + '/api/user/app/uhit', {
					data: {
						hid: hid
					},
					dataType: 'json',
					type: 'post',
					async: true,
					success: function(data) {
						//console.log('success');
					},
					error: function(xhr, type, errorThrown) {
						console.log(type);
					}
				});
				if(hid != null && hid != "") {
					mui.openWindow({
						url: 'coindetail2.html',
						id: 'coindetail2',
						extras: {
							hid: hid
						}
					});
				} else {
					mui.toast('未知榜单', {
						duration: '2000ms',
						type: 'div'
					})
				}
			}
		</script>
	</body>

</html>